import {createApp} from 'vue'
import globalConstant from './components/GlobalConstant.vue'
import axios from 'axios';
import routerJs from './router/index'
import Interceptor from './js/interceptor.js'
// import router from './router.js'
import App from './App.vue'
import router from './router'

import ElementPlus from 'element-plus'
import 'element-plus/lib/theme-chalk/index.css'



const app = createApp(App).use(router)
app.use(ElementPlus)
app.use(routerJs)
app.use(Interceptor)

app.config.globalProperties.$axios = axios;
app.config.globalProperties.$Global = globalConstant;

router.beforeEach((to, from, next) => {
    /* 路由发生变化修改页面title */
    if (to.meta.title) {
        document.title = to.meta.title
    }
    next()
})

app.mount('#app')